' ***********************************************************************
' Assembly         : Ioc
' Author           : Tim Ford
' Created          : 10-02-2013
'
' Last Modified By : Tim Ford
' Last Modified On : 10-02-2013
' ***********************************************************************
' <copyright file="SingleTypeInstance.vb" company="Red Baron Solutions">
'     Red Baron Solutions. All rights reserved.
' </copyright>
' <summary></summary>
' ***********************************************************************
Namespace Ioc
    ''' <summary>
    ''' 	
    ''' </summary>
    ''' <typeparam name="T"></typeparam>
    Friend Class SingleTypeInstance(Of T As {New, Class})
        Inherits BaseFactory

        ''' <summary>
        ''' Initializes a new instance of the <see cref="SingleTypeInstance(Of T)" /> class.	
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()
            m_Lazy = New Lazy(Of T)
        End Sub
        Private m_Lazy As Lazy(Of T)

        ''' <summary>
        ''' Gets the object.	
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Overrides Function GetObject() As Object
            Return m_Lazy.Value
        End Function
    End Class
End Namespace
